import { createApp } from "vue";
import { createPinia } from "pinia";
import { createPersistedState } from "pinia-persistedstate-plugin";
import ElementPlus from "element-plus";
import zhCn from "element-plus/es/locale/lang/zh-cn";
import router from "./router";
import registerPlugins from "./plugins";

import App from "./App.vue";
import "element-plus/dist/index.css";
import "./assets/css/index.less";
const store = createPinia();
const app = createApp(App);
// 注册持久化插件
store.use(createPersistedState());
app.use(store);
app.use(ElementPlus, {
  locale: zhCn
});
app.use(router);
registerPlugins(app);
app.mount("#app");
// 阻止保存事件
window.addEventListener("keydown", event => {
  if (event.ctrlKey && event.key === "s") event.preventDefault();
});
